import { addNameSpace } from './util'

const NAME_SPACE = 'SIGN_EDIT'

const addPrefix = addNameSpace(NAME_SPACE)

// 设置初始值
export const SET_DATA = addPrefix('SET_DATA')

// 清除数据
export const CLEAR = addPrefix('CLEAR')

// 设置签名
export const SET_SIGN = addPrefix('SET_SIGN')

// 设置行业
export const SET_INDUSTRY = addPrefix('SET_INDUSTRY')

// 设置应用场景
export const SET_SCENARIOS = addPrefix('SET_SCENARIOS')

// 添加签名
export const ADD = addPrefix('ADD')

// 添加名成功
export const ADD_SUCCESS = addPrefix('ADD_SUCCESS')

// 添加名失败
export const ADD_FAIL = addPrefix('ADD_FAIL')

// 获取行业枚举
export const GET_INDUSTRY_ENUM = addPrefix('GET_INDUSTRY_ENUM')

// 获取行业枚举成功
export const GET_INDUSTRY_ENUM_SUCCESS = addPrefix('GET_INDUSTRY_ENUM_SUCCESS')

// 获取应用场景枚举
export const GET_SCENARIOS_ENUM = addPrefix('GET_SCENARIOS_ENUM')

// 获取应用场景枚举
export const GET_SCENARIOS_ENUM_SUCCESS = addPrefix('GET_SCENARIOS_ENUM_SUCCESS')


export const setData = (data) => ({ type: SET_DATA, data })

export const clear = () => ({ type: CLEAR })

export const setSign = (sign) => ({ type: SET_SIGN, sign })

export const setIndustry = (industry) => ({ type: SET_INDUSTRY, industry })

export const setScenarios = (scenarios) => ({ type: SET_SCENARIOS, scenarios })

export const add = () => ({ type: ADD })

export const addSuccess = () => ({ type: ADD_SUCCESS })

export const addFail = () => ({ type: ADD_FAIL })

export const getIndustryEnum = () => ({ type: GET_INDUSTRY_ENUM })

export const getIndustryEnumSuccess = (industryEnum) => ({ type: GET_INDUSTRY_ENUM_SUCCESS, industryEnum })

export const getScenariosEnum = () => ({ type: GET_SCENARIOS_ENUM })

export const getScenariosEnumSuccess = (scenariosEnum) => ({ type: GET_SCENARIOS_ENUM_SUCCESS, scenariosEnum })


export default {
  setData,
  clear,
  setSign,
  setIndustry,
  setScenarios,
  add,
  addSuccess,
  addFail,
  getIndustryEnum,
  getIndustryEnumSuccess,
  getScenariosEnum,
  getScenariosEnumSuccess
}